All files / src/components/layout AdminLayout.tsx

0% Statements 0/12
100% Branches 0/0
0% Functions 0/1
0% Lines 0/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72                                                                                                                                               
'use client';
 
import { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import useLoadNamespace from '@/hooks/useLoadNamespace';
import AdminSidebar from './AdminSidebar';
import { Breadcrumbs, BreadcrumbItem } from '@/components/ui/breadcrumbs';
import { APP_CONFIG } from '@/constants/app';
import ThemeSelector from '@/components/ThemeSelector';
import { GlobalSearch } from '@/components/admin/GlobalSearch';
import NotificationsDropdown from '@/components/ui/notifications-dropdown';
import TMDBAttribution from '@/components/common/TMDBAttribution';
 
interface AdminLayoutProps {
  children: ReactNode;
  breadcrumbs?: { label: string; href?: string }[];
}
 
export default function AdminLayout({ children, breadcrumbs }: AdminLayoutProps) {
  useLoadNamespace('admin');
  const { t } = useTranslation();
  return (
    <div className="flex h-screen bg-background">
      {/* Sidebar */}
      <AdminSidebar />
 
      {/* Main Content */}
      <div className="flex-1 flex flex-col overflow-hidden">
        {/* Header */}
        <header className="bg-card border-b border-border px-6 py-4">
          <div className="flex items-center justify-between mb-4">
            <div>
              <h1 className="text-2xl font-bold text-foreground">{APP_CONFIG.NAME}</h1>
              <p className="text-muted-foreground">{t('layout.adminDashboard')}</p>
            </div>
 
            {/* Header Actions */}
            <div className="flex items-center space-x-4">
              <NotificationsDropdown variant="admin" />
              <ThemeSelector />
              <div className="flex items-center space-x-2 text-sm text-muted-foreground">
                <div className="w-2 h-2 bg-green-500 rounded-full"></div>
                <span>{t('layout.online')}</span>
              </div>
            </div>
          </div>
 
          {/* Search and Breadcrumbs Row */}
          <div className="flex items-center justify-between">
            <div className="flex-1">
              <Breadcrumbs
                items={breadcrumbs as BreadcrumbItem[]}
                showHome={true}
                homeHref="/admin"
              />
            </div>
            <div className="ml-4">
              <GlobalSearch />
            </div>
          </div>
        </header>
 
        {/* Main Content Area */}
        <main className="flex-1 overflow-y-auto p-6">
          {children}
          <TMDBAttribution className="mt-10 pb-6" />
        </main>
      </div>
    </div>
  );
}